import QtQuick 2.6
import QtQuick.Layouts 1.2

import "../Base/UiBase"
import "../Base/Config"

import Data 1.0

Rectangle {
    id: root

    color: Color.background

    ColumnLayout {
        anchors.fill: parent
        spacing: 0
        Rectangle {
            Layout.fillWidth: true
            Layout.preferredHeight: 96 * Size.ratio
            color: Color.main
            Text {
                anchors.centerIn: parent
                text: qsTr("我的")
                color: Color.foreground
                font.pixelSize: Size.titleFont
            }

            // setting button
            LoaderMouseArea {
                onClicked:settingLoader.source = "Setting/Index.qml"

                width: 90 * Size.ratio
                height: 90 * Size.ratio
                anchors.right: parent.right
                anchors.verticalCenter: parent.verticalCenter

                loader: Loader {
                    parent: mainRoot
                    id:settingLoader
                    anchors.fill: parent
                }


                SvgzImage {
                    anchors.centerIn: parent
                    width: 40 * Size.ratio
                    height: 40 * Size.ratio
                    source: "../../resources/personal/shezhi.svg"
                }
            } // end setting button
            BottomDivider{}
        }

        Head {
            Layout.fillWidth: true
            Layout.preferredHeight: 410 * width / 720
            Rectangle {
                anchors.bottom: parent.bottom

                width: parent.width
                height: 100 * Size.ratio

                color: Qt.rgba(0, 0, 0, 0.25)
                RowLayout {
                    anchors.fill: parent
                    MouseArea {
                        Layout.fillWidth: true
                        Layout.fillHeight: true
                        Text {
                            anchors.centerIn: parent
                            color: Color.foreground
                            font.pixelSize: Size.font32
                            text: qsTr("我的圈子")
                        }

                        RightDivider {
                            color: Color.foreground
                            height: 0.8 * parent.height
                        }

                    }
                    LoaderMouseArea {
                        onClicked: loader.source = "Dynamic/Index.qml"

                        Layout.fillWidth: true
                        Layout.fillHeight: true

                        loader: Loader {
                            parent:mainRoot
                            anchors.fill: parent
                        }
                        Text {
                            anchors.centerIn: parent
                            color: Color.foreground
                            font.pixelSize: Size.font32
                            text: qsTr("动态")
                        }
                    }
                }
            }
        }
        Item {
            Layout.fillWidth: true
            Layout.preferredHeight: Size.elementInterval
        }

        Flickable {
            Layout.fillWidth: true
            Layout.fillHeight: true
            Column {
                width: root.width
                // 个人资料
                MouseArea {
                    width: parent.width
                    height: 90 * Size.ratio
                    Rectangle {
                        anchors.fill: parent
                        color: Color.foreground
                    }

                    SvgzImage {
                        x: 40 * Size.ratio
                        anchors.verticalCenter: parent.verticalCenter
                        width: 220 * Size.ratio
                        height: 40 * Size.ratio
                        source: "../../resources/personal/gerenziliao.svg"
                    }
                    BottomDivider{}
                }
                // 我的勋章
                MouseArea {
                    width: parent.width
                    height: 90 * Size.ratio
                    Rectangle {
                        anchors.fill: parent
                        color: Color.foreground
                    }

                    SvgzImage {
                        x: 40 * Size.ratio
                        anchors.verticalCenter: parent.verticalCenter
                        width: 220 * Size.ratio
                        height: 40 * Size.ratio
                        source: "../../resources/personal/wodexunzhang.svg"
                    }
                    BottomDivider{}
                }
                // 我的收藏
                LoaderMouseArea {
                    onClicked: loader.source = "Favorite/Index.qml"

                    width: parent.width
                    height: 90 * Size.ratio

                    loader: Loader {
                        anchors.fill: parent
                        parent: mainRoot
                    }
                    Rectangle {
                        anchors.fill: parent
                        color: Color.foreground
                    }

                    SvgzImage {
                        x: 40 * Size.ratio
                        anchors.verticalCenter: parent.verticalCenter
                        width: 220 * Size.ratio
                        height: 40 * Size.ratio
                        source: "../../resources/personal/wodeshoucang.svg"
                    }
                    BottomDivider{}
                }

                Item {
                    width: parent.width
                    height: Size.elementInterval
                }
                // 专评
                LoaderMouseArea {
                    onClicked: loader.source = "P2p/Index.qml"

                    width: parent.width
                    height: 90 * Size.ratio

                    loader: Loader {
                        anchors.fill: parent
                        parent: mainRoot
                    }

                    Rectangle {
                        anchors.fill: parent
                        color: Color.foreground
                    }

                    SvgzImage {
                        x: 40 * Size.ratio
                        anchors.verticalCenter: parent.verticalCenter
                        width: 220 * Size.ratio
                        height: 40 * Size.ratio
                        source: "../../resources/personal/wodezhuanping.svg"
                    }
                    BottomDivider{}
                }
                // 我的评论
                LoaderMouseArea {
                    onClicked: loader.source = "MultiComment/Index.qml"

                    width: parent.width
                    height: 90 * Size.ratio

                    loader: Loader {
                        parent:mainRoot
                        anchors.fill: parent
                    }

                    Rectangle {
                        anchors.fill: parent
                        color: Color.foreground
                    }
                    SvgzImage {
                        x: 40 * Size.ratio
                        anchors.verticalCenter: parent.verticalCenter
                        width: 220 * Size.ratio
                        height: 40 * Size.ratio
                        source: "../../resources/personal/wodedianping.svg"
                    }
                    BottomDivider{}
                }
                // 我的作品
                LoaderMouseArea {
                    onClicked: postLoader.source = "MultiPost/Index.qml"

                    width: parent.width
                    height: 90 * Size.ratio

                    loader: Loader {
                        anchors.fill: parent
                        parent: mainRoot
                    }

                    Rectangle {
                        anchors.fill: parent
                        color: Color.foreground
                    }
                    SvgzImage {
                        x: 40 * Size.ratio
                        anchors.verticalCenter: parent.verticalCenter
                        width: 220 * Size.ratio
                        height: 40 * Size.ratio
                        source: "../../resources/personal/wodezuoping.svg"
                    }
                    BottomDivider{}
                }

                // 我的积分
                MouseArea {
                    width: parent.width
                    height: 90 * Size.ratio
                    Rectangle {
                        anchors.fill: parent
                        color: Color.foreground
                    }

                    SvgzImage {
                        x: 40 * Size.ratio
                        anchors.verticalCenter: parent.verticalCenter
                        width: 220 * Size.ratio
                        height: 40 * Size.ratio
                        source: "../../resources/personal/wodejifeng.svg"
                    }
                    BottomDivider{}
                }
            }
        }
    }
}
